package com.gc.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gc.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.gc.business.mapper.GovManageMapper;
import com.gc.business.domain.GovManage;
import com.gc.business.service.IGovManageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;

/**
 * 政府机构管理 服务层实现
 * 
 * @author hruiyan
 * @date 2020-11-12
 */
@Slf4j
@Service
public class GovManageServiceImpl extends ServiceImpl<GovManageMapper, GovManage> implements IGovManageService {

    @Override
    public List<GovManage> list(GovManage govManage){
        LambdaQueryWrapper<GovManage> wrapper = new LambdaQueryWrapper<>();
        if(govManage != null){
            if(StringUtils.isNotEmpty(govManage.getId())){
                wrapper.eq(GovManage::getId, govManage.getId());
            }
            if(StringUtils.isNotEmpty(govManage.getGovId())){
                wrapper.eq(GovManage::getGovId, govManage.getGovId());
            }
            if(StringUtils.isNotEmpty(govManage.getGovName())){
                wrapper.like(GovManage::getGovName, govManage.getGovName());
            }
            if(StringUtils.isNotEmpty(govManage.getLogoUrl())){
                wrapper.eq(GovManage::getLogoUrl, govManage.getLogoUrl());
            }
            if(StringUtils.isNotEmpty(govManage.getLongitude())){
                wrapper.eq(GovManage::getLongitude, govManage.getLongitude());
            }
            if(StringUtils.isNotEmpty(govManage.getLatitude())){
                wrapper.eq(GovManage::getLatitude, govManage.getLatitude());
            }
            if(StringUtils.isNotEmpty(govManage.getCreateBy())){
                wrapper.eq(GovManage::getCreateBy, govManage.getCreateBy());
            }
            if(StringUtils.isNotEmpty(govManage.getCreateTime())){
                wrapper.eq(GovManage::getCreateTime, govManage.getCreateTime());
            }
            if(StringUtils.isNotEmpty(govManage.getUpdateBy())){
                wrapper.eq(GovManage::getUpdateBy, govManage.getUpdateBy());
            }
            if(StringUtils.isNotEmpty(govManage.getUpdateTime())){
                wrapper.eq(GovManage::getUpdateTime, govManage.getUpdateTime());
            }
            if(StringUtils.isNotEmpty(govManage.getRemark())){
                wrapper.eq(GovManage::getRemark, govManage.getRemark());
            }
        }
        return baseMapper.selectList(wrapper);
    }
}
